'use strict';

const Service = require('egg').Service;

class UserService extends Service {
  async searchAll() {
    // 假如 我们拿到用户 id 从数据库获取用户详细信息
    const users = await this.app.mysql.select('user');
    return { users };
  }

  async findCode(code) {
    const result = await this.app.mysql.get('user', { code });
    return { result };
  }


}

module.exports = UserService;